const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');

const URL_PREFIX='/node'

const port = 3000;
const app = express();
app.use(bodyParser.json());
require('./config/eureka-helper').registerWithEureka('node', port)

const router = express.Router();
router.get('/test', (req, res) => {
    console.log('request come...');
    res.send('test');
});
router.get('/obj', (req, res) => {
    console.log('request come...');
    res.send({name: 'licoded', age: 21});
});

app.use(URL_PREFIX, router);
app.listen(port);
console.log(`Heroes service listening on port http://localhost:${port}`);
